home *** CD-ROM | disk | FTP | other *** search
/ PC Media 3 / PC MEDIA CD03.iso / share / udos / pppd / pppd.doc < prev    next >
Encoding:
Text File  |  1990-04-17  |  7.7 KB  |  153 lines

  1.  
  2. ____PPPD (Push/Pop Path & Directory)                                  Ver. 3.01
  3.  
  4. Purpose: Batch file utility.  Allows current drive:\directory and path to
  5.          be pushed (saved) into and later popped (restored) from a file.
  6.          It keeps its data in a file.
  7.  
  8. Format:        PPPD PUSH
  9.            or
  10.                PPPD POP [M]
  11.  
  12.          M pops to the master environment as well as the current one.
  13.  
  14. Remarks: PPPD PUSH causes the current drive, directory and path to be
  15.          placed in a file.  Repeated PPPD PUSHes keep stacking the then-
  16.          current drive, &c. in the file.
  17.  
  18.          PPPD POP switches to the most recently PUSHed drive:\directory &
  19.          path and removes it from the file.  When it's popped all the data,
  20.          it deletes the file.
  21.  
  22.          By default, the path is popped into the current active environ-
  23.          ment, the one from which PPPD is called.  This is what you normal-
  24.          ly require.  If you run with an extra layer of COMMAND.COM or any
  25.          other shell (like DESQview), and especially if you do a lot of
  26.          switching shells (stepping through the DOS door in a program, for
  27.          instance), you might want to use the M option.  That makes PPPD
  28.          pop the path into the master environment (the environment belong-
  29.          ing to the lowest layer of DOS) also.
  30.  
  31.          If you don't know what I'm talking about, don't worry.  Use PPPD
  32.          POP.  If it seems that PPPD isn't restoring the path properly, try
  33.          PPPD POP M.
  34.  
  35.          To use PPPD in a batch file, first, put a line, PPPD PUSH.  Then
  36.          put your lines setting up and switching to an application, even
  37.          changing the path string; when the application is finished, PPPD
  38.          POP puts the computer back the way it was.
  39.  
  40.          If something goes wrong (usually an attempt to pop from an empty
  41.          stack file, but possibly insufficient room in the environment for
  42.          the PATH string), PPPD exits, setting the  DOS errorlevel as fol-
  43.          lows:
  44.  
  45.             0   No error.  Everything went well.
  46.  
  47.             1   Complete failure.  No data file to pop, couldn't open
  48.                 data file to push etc.  Path not popped.
  49.  
  50.             2   (M option only) Popped path into the active environment
  51.                 but couldn't pop it to the master environment.
  52.  
  53.             3   (M option only) Popped path into the master environment
  54.                 but couldn't pop it to the active environment.
  55.  
  56.             255 Syntax error: (no PUSH or POP, Option other than M, &c.)
  57.  
  58.          For most purposes, it's probably wise to make sure PPPD starts
  59.          with a fresh stack file at boot-up.  Put a line in AUTOEXEC.BAT to
  60.          DEL C:\STACK3.PPD (or whatever you're using for PPPD's stack).  On
  61.          the other hand, if you make a point to PPPD PUSH just before you
  62. ____PPPD (Push/Pop Path & Directory)                                     Page 2
  63.  
  64.          turn off the computer, PPPD POP in AUTOEXEC.BAT will bring the ma-
  65.          chine up just as you left it.
  66.  
  67.  
  68. Why Change the Path?
  69.  
  70.          Restoring the DOS path string is PPPD's special feature.  Why do
  71.          you need it?  Many people set a path which runs through all the
  72.          directories that contain executable files and never change it.  If
  73.          you use your PC to do just one or two kinds of task and always
  74.          need the whole set of executable files on tap, then you don't need
  75.          to change the path and you don't need PPPD.  (An earlier program
  76.          of mine called "PPD" and several other programs with names like
  77.          "PUSHDIR" and "POPDIR" do all you need.)
  78.  
  79.          On the other hand, if you do many different kinds of things on
  80.                                           ___         your PC, you probably don't need all the executable files avail-
  81.                   _____         able for every kind of task.  When you're writing letters, you
  82.          really don't need the debugger handy, and you don't need the thes-
  83.          aurus when you're debugging.  The main reason for changing the
  84.          path string, is to keep it short.  DOS will find a program faster
  85.          if the path it has to hunt through is short.  In addition, occa-
  86.          sionally, you may find it convenient to make sure certain files
  87.              ___         are off the path at certain times.
  88.  
  89.          So, it's useful to change the path when you change tasks.  Nor-
  90.          mally, you'll do it with a batch file or a CED synonym.  PPPD can
  91.          be called from either of these, when you want to make a temporary
  92.          change.  It's especially handy when you're setting up a disk for
  93.          other people who may not be swift about putting things back when
  94.          they depart.
  95.  
  96.  
  97. To Customize PPPD's File:
  98.  
  99.          As supplied, PPPD will build its stack of data in a file called
  100.          STACK3.PPD on the root directory of drive C:.  If this is incon-
  101.          venient, you can change the specification with DEBUG or with a
  102.          disk editor like Peter Norton's NU.  Search the file for "FLAG:".
  103.          Immediately thereafter, begins the filespec.  You should see:
  104.  
  105.             FLAG:C:\STACK3.PPD
  106.  
  107.          Leave the FLAG: and change the rest to what you will.  One thing
  108.          is important: after my C:\STACK3.PPD, you'll see a lot of zeros
  109.          (00 - not the character "0", 30).  Your filespec must begin with
  110.          the character next after the colon in "FLAG:" and must not exceed
  111.          the field of zeros.  There must be at least one zero IMMEDIATELY
  112.          after the end of the file spec you insert, thus:
  113.  
  114.             1. Do not overwrite all the zeros; leave at least one.
  115.  
  116.             2. If your file spec is shorter than mine, fill out the
  117.                unused parts of the field with zeros.
  118. ____PPPD (Push/Pop Path & Directory)                                     Page 3
  119.  
  120. Notes:   The hard part of this program (getting and setting the path) is
  121.          done by Kim Kokkonen's TPENV.  He distributes it free, and I here-
  122.          by gratefully acknowledge it.
  123.  
  124.          The routines used in version 2 ff to write to the current active
  125.          environment are modeled on those in Barry Simon's piece in "Lab
  126.                  ___________         Notes," PC Magazine, v8n20, pp 309-14.
  127.  
  128. Versions:
  129.  
  130.          2.00 (Nov. 1989) changes the way the POP function works.  Version
  131.              1 popped the path from the data file to the master environ-
  132.              ment.  It was satisfactory if you run with the ordinary single
  133.              layer of COMMAND.COM but not if you operate with an extra
  134.              shell.  Since POP restored the path to the master environment
  135.              only, you wouldn't see it until you EXITed the extra shell.
  136.  
  137.              Version 2's M option does something to correct that.  The
  138.              ordinary POP function puts the path into the active environ-
  139.              ment (the one active when PPPD is run).  The M option writes
  140.              to the master environment also.  PPPD could still be flummox-
  141.              ed, however, by a sufficiently balled up sequence of shells
  142.              and DOS doors.
  143.  
  144.          3.00 (Jan. 1990) enlarges the size of the maximum path string that
  145.              can be handled to 254 characters.  The DOS command line can't
  146.              hold more than 128 characters, but it's possible to make a
  147.              longer strings by playing tricks.  Stack file name changed to
  148.              STACK3.PPD to avoid confusion with previous versions.  3.01
  149.              corrects a bug in errorlevel setting.
  150.  
  151.  
  152.                                                    R. N. Wisan --April 1990
  153.                                           37 Clinton St., Oneonta, NY 13820